<?php
class ControleLogin extends Control
{
	public function __construct()
	{
		parent::__construct();

		if(isset($_SESSION['user']))
			return true;
		else
			return $this->login();
	}

	public function login()
	{
		return $this->view;
	}

	public function logar()
	{
		if(!isset($_SESSION['user']))
		{
			$_SESSION['user'] = array();
			$_SESSION['user']['login'] = 'Marcelo';
		}

		return $this->redirect(BASE.'teste');
	}

	public function logout()
	{
		if(isset($_SESSION['user']))
			unset($_SESSION['user']);

		return $this->redirect(BASE);
	}
}